namespace Quiki.ExpressionParsers
{
    public class WikiInternalLinkElement : WikiTextElement
    {
        public WikiInternalLinkElement ()
            : base (WikiTextElementType.InternalLink)
        {
            Terminal = true;
        }

        public bool Exists
        {
            get { return exists; }
            set { exists = value; }
        }

        public string LinkText
        {
            get 
            { 
                if (Properties.ContainsKey("text"))
                    return (string)Properties["text"];

                return null;
            }

            set { Properties["text"] = value; }
        }

        public WikiDocReference Reference
        {
            get { return (WikiDocReference)Properties["reference"]; }
            set { Properties["reference"] = value; }
        }

        private bool exists;
    }
}